<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>dps.csrAsn1Creator.CsrAsn1Creator</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css"></link>
</head>
<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">

<!-- =========== START OF NAVBAR =========== -->
<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="center">
    <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar" href="trees.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
    <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar" href="indices.html">Index</a>&nbsp;&nbsp;&nbsp;</th>
    <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar" href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
    <th class="navbar" align="right" width="100%">
      <table border="0" cellpadding="0" cellspacing="0">
      <tr><th class="navbar" align="center">
        <p class="nomargin">
          <a class="navbar" target="_top" href="http://code.google.com/p/dps-x509/">DPS</a>
      </p></th></tr></table>
    </th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <font size="-1"><b class="breadcrumbs">
        <a href="dps-module.html">Package&nbsp;dps</a> ::
        <a href="dps.csrAsn1Creator-module.html">Module&nbsp;csrAsn1Creator</a> ::
        Class&nbsp;CsrAsn1Creator
      </b></font></br>
    </td>
    <td><table cellpadding="0" cellspacing="0">
      <tr><td align="right"><font size="-2">[<a href="../private/dps.csrAsn1Creator.CsrAsn1Creator-class.html">show&nbsp;private</a>&nbsp;|&nbsp;hide&nbsp;private]</font></td></tr>
      <tr><td align="right"><font size="-2">[<a href="frames.html"target="_top">frames</a>&nbsp;|&nbsp;<a href="dps.csrAsn1Creator.CsrAsn1Creator-class.html" target="_top">no&nbsp;frames</a>]</font></td></tr>
    </table></td>
</tr></table>

<!-- =========== START OF CLASS DESCRIPTION =========== -->
<h2 class="class">Class CsrAsn1Creator</h2>

<hr/>

<p>Responsible for making ASN.1 data from python objects. We cheat a bit 
here. Rather than building a document from scratch we take a copy of a 
template certificate and modify its contents. This was largely due to 
time constraints</p>
<p>important conversions to know:</p>
We are dealing with 3 main datatypes:
<ul>
  <li>
    Asn1: <a 
    href="http://en.wikipedia.org/wiki/Asn1">http://en.wikipedia.org/wiki/Asn1</a>
  </li>
  <li>
    Bytes: <a 
    href="http://en.wikipedia.org/wiki/Bytes">http://en.wikipedia.org/wiki/Bytes</a>
  </li>
  <li>
    Base64: <a 
    href="http://en.wikipedia.org/wiki/Base64">http://en.wikipedia.org/wiki/Base64</a>
  </li>
</ul>
<hr/>


<!-- =========== START OF METHOD SUMMARY =========== -->
<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="summary">
  <th colspan="2">Method Summary</th></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="dps.csrAsn1Creator.CsrAsn1Creator-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class=summary-sig-arg>self</span>,
          <span class=summary-sig-arg>params</span>,
          <span class=summary-sig-arg>privateKey</span>)</span></code>
<br />
create a certificate with params</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">        asn1
</font></td>
  <td><code><span class="summary-sig"><a href="dps.csrAsn1Creator.CsrAsn1Creator-class.html#getAsn1" class="summary-sig-name"><code>getAsn1</code></a>(<span class=summary-sig-arg>self</span>)</span></code>
<br />
get entire certificate in asn1 format</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">        string
</font></td>
  <td><code><span class="summary-sig"><a href="dps.csrAsn1Creator.CsrAsn1Creator-class.html#getBase64" class="summary-sig-name"><code>getBase64</code></a>(<span class=summary-sig-arg>self</span>)</span></code>
<br />
get entire certificate in base64 format</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">        keyczar.keys.RsaPrivateKey
</font></td>
  <td><code><span class="summary-sig"><a href="dps.csrAsn1Creator.CsrAsn1Creator-class.html#getRsaPrivateKey" class="summary-sig-name"><code>getRsaPrivateKey</code></a>(<span class=summary-sig-arg>self</span>)</span></code>
<br />
get the private key from the certificate</td></tr>
</table><br />


<!-- =========== START OF METHOD DETAILS =========== -->
<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="details">
  <th colspan="2">Method Details</th></tr>
</table>

<a name="__init__"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">__init__</span>(<span class=sig-arg>self</span>,
          <span class=sig-arg>params</span>,
          <span class=sig-arg>privateKey</span>=<span class=sig-default>None</span>)</span>
    <br /><i>(Constructor)</i>
  </h3>
  create a certificate with params
  <dl><dt></dt><dd>
    <dl><dt><b>Parameters:</b></dt>
      <dd><code><b>params</b></code> -
         data to but in the csr
        <br /><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        (type=dps.x509.certificateParams.X509CertificateParams 
              &#64;param privateKey:private key used to sign the csr 
              &#64;type 
              privateKey:privateKey:keyczar.keys.RsaPrivateKey)</i>
      </dd>
    </dl>
    <dl><dt><b>Raises:</b></dt>
      <dd><code><b>dps.errors.RsaPrivateKeyCreateError</b></code> -
        if unable to create the certifcate
    </dl>
  </dd></dl>
</td></tr></table>

<a name="getAsn1"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">getAsn1</span>(<span class=sig-arg>self</span>)</span>
  </h3>
  get entire certificate in asn1 format
  <dl><dt></dt><dd>
    <dl><dt><b>Returns:</b></dt>
      <dd>
        asn1
      </dd>
    </dl>
    <dl><dt><b>Raises:</b></dt>
      <dd><code><b>dps.errors.CertificateNotSignedError</b></code> -
        if the certificate has yet to be signed
    </dl>
  </dd></dl>
</td></tr></table>

<a name="getBase64"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">getBase64</span>(<span class=sig-arg>self</span>)</span>
  </h3>
  get entire certificate in base64 format
  <dl><dt></dt><dd>
    <dl><dt><b>Returns:</b></dt>
      <dd>
        string
      </dd>
    </dl>
    <dl><dt><b>Raises:</b></dt>
      <dd><code><b>dps.errors.CertificateNotSignedError</b></code> -
        if the certificate has yet to be signed
    </dl>
  </dd></dl>
</td></tr></table>

<a name="getRsaPrivateKey"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">getRsaPrivateKey</span>(<span class=sig-arg>self</span>)</span>
  </h3>
  get the private key from the certificate
  <dl><dt></dt><dd>
    <dl><dt><b>Returns:</b></dt>
      <dd>
        keyczar.keys.RsaPrivateKey
      </dd>
    </dl>
  </dd></dl>
</td></tr></table>
<br />


<!-- =========== START OF NAVBAR =========== -->
<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="center">
    <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar" href="trees.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
    <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar" href="indices.html">Index</a>&nbsp;&nbsp;&nbsp;</th>
    <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar" href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
    <th class="navbar" align="right" width="100%">
      <table border="0" cellpadding="0" cellspacing="0">
      <tr><th class="navbar" align="center">
        <p class="nomargin">
          <a class="navbar" target="_top" href="http://code.google.com/p/dps-x509/">DPS</a>
      </p></th></tr></table>
    </th>
  </tr>
</table>

<table border="0" cellpadding="0" cellspacing="0" width="100%">
  <tr>
    <td align="left"><font size="-2">Generated by Epydoc 2.1 on Sun Oct 24 22:24:02 2010</font></td>
    <td align="right"><a href="http://epydoc.sourceforge.net"
                      ><font size="-2">http://epydoc.sf.net</font></a></td>
  </tr>
</table>
</body>
</html>
